﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace Framework.Platform.Components.UI.SplashScreen
{
    public partial class SplashScreenForm : Form, ISplashScreen
    {
        public const string VersionText = "BizFramework";
        private Bitmap _Bitmap;

        public SplashScreenForm()
        {
            InitializeComponent();

            FormBorderStyle = FormBorderStyle.None;
            StartPosition = FormStartPosition.CenterScreen;
            ShowInTaskbar = false;
#if DEBUG
            string versionText = VersionText + " (Debug)";
#else
			string versionText = VersionText;
#endif
            _Bitmap = new Bitmap(AppDomain.CurrentDomain.BaseDirectory + "\\Images\\SplashScreen.jpg");
            this.ClientSize = _Bitmap.Size;
            using (Font font = new Font("Sans Serif", 10))
            {
                using (Graphics g = Graphics.FromImage(_Bitmap))
                {
                    g.DrawString(versionText, font, Brushes.Black, 10, _Bitmap.Height - 25);
                }
            }
            BackgroundImage = _Bitmap;
        }

        #region ISplashScreen Members

        public void ShowUI()
        {
            this.Show();
        }

        #endregion
    }
}
